﻿
Public Class cSedes
    Dim daSedes As dsGlobalTableAdapters.GLO_SEDESTableAdapter
    Dim dtSedes As dsGlobal.GLO_SEDESDataTable
    Dim drSedes As dsGlobal.GLO_SEDESRow
    Dim iMuni As cMunicipios
    Sub New(ByVal idSede As String)
        Try
            daSedes = New dsGlobalTableAdapters.GLO_SEDESTableAdapter
            dtSedes = daSedes.GetDataByIdSede(idSede)
            If dtSedes.Rows.Count > 0 Then
                drSedes = dtSedes.Rows(0)
                iMuni = New cMunicipios(drSedes.CIUDAD)
            Else
                Throw New Exception("Sede no se econtro, favor verificar e intentar de nuevo")
            End If
        Catch ex As Exception
            Throw ex
        End Try
    End Sub
    Public ReadOnly Property idSede() As String
        Get
            Return drSedes.IDSEDE
        End Get
    End Property

    Public ReadOnly Property nombre() As String
        Get
            Return drSedes.NOMBRE
        End Get

    End Property

    Public ReadOnly Property direccion() As String
        Get
            Return drSedes.DIRECCION
        End Get
    End Property

    Public ReadOnly Property telefono() As String
        Get
            Return drSedes.TELEFONO
        End Get
    End Property

    Public ReadOnly Property sincroniza() As String
        Get
            Return drSedes.SINCRONIZA
        End Get
    End Property

    Public ReadOnly Property Ciudad() As String
        Get
            Return iMuni.Municipio
        End Get
    End Property

End Class
